﻿using System.IO;
using System.Web.Mvc;
using System.Web.UI;

namespace Uber.WebUI
{
    public static class UberHelpers
    {
        public static string GenerateCaptcha(this HtmlHelper helper)
        {
            var captchaControl = new Recaptcha.RecaptchaControl
                                     {
                                         ID = "recaptcha",
                                         Theme = "blackglass",
                                         PublicKey = "6LcInwsAAAAAAEbKFi0AnqacM3PUwnd5XseJVtKB",
                                         PrivateKey = "6LcInwsAAAAAAN8BlQaHUlAuVzZ4VWIAZe4AWPLg"
                                     };

            using (var htmlWriter = new HtmlTextWriter(new StringWriter()))
            {
                captchaControl.RenderControl(htmlWriter);

                return htmlWriter.InnerWriter.ToString();
            }
        }
    }
}